from django.shortcuts import render
from django_web import models
# Create your views here.
from django_web.models import *


def insert(request):
    if request.method == "POST":
        username = request.POST.get("username", None)
        password = request.POST.get("password", None)
        twz = Message.objects.create(username=username, password=password)
        twz.save()
    return render(request, 'insert.html')


def list(request):
    people_list = Message.objects.all()
    return render(request, 'show.html', {"people_list": people_list})
